package com.robusta.app.auth.model;

import com.robusta.app.domain.user.UserType;

import java.util.Random;

public class UserModelFixture {
    private Long id;
    private String name;
    private String loginName;
    private String password;
    private UserType userType;
    private String email;

    private UserModelFixture() {
    }

    public static UserModelFixture aUserModel() {
        return new UserModelFixture();
    }

    public UserModelFixture withDefaults() {
        Random random = new Random();
        this.id = random.nextLong();
        this.name = "Last, First, I";
        this.loginName = "UT_IT";
        this.password = String.valueOf(random.nextLong());
        this.userType = UserType.FirstMapper;
        this.email = "utit@app.com";
        return this;
    }

    public UserModel build() {
        return new UserModel(id, name, loginName, password, userType, email);
    }

    public UserModelFixture withLoginName(String loginName) {
        this.loginName = loginName; return this;
    }

    public UserModelFixture withId(long id) {
        this.id = id; return this;
    }
}
